<include file="Public:header" />
<include file="Public:leftside" />
<script src="/Store/js/My97DatePicker/WdatePicker.js"></script>
<script src="/static/js/layer2.1/layer.js"></script>
<style type="text/css">
	.panel-heading {
		padding: 10px 15px 35px;
	}
</style>
<div class="main-content">
	<div class="breadcrumbs breadcrumbs-fixed" id="breadcrumbs">
		<ul class="breadcrumb">
			<li> <i class="icon-home home-icon"></i> <a href="/">会员</a> </li>
			<li class="active">添加会员</li>
		</ul>
	</div>
	<section class="scrollable wrapper">

		<section class="panel panel-default">
			<header class="panel-heading text-right bg-light">
				<ul class="nav nav-tabs pull-left">
					<li class="active"><a href="#no_user" data-toggle="tab">无账号注册会员</a></li>
					<li class=""><a href="#user" data-toggle="tab">已有账号注册会员</a></li>
				</ul>
				<span class="hidden-sm"></span>
			</header>
			<div class="panel-body">
				<div class="tab-content">

					<div class="tab-pane fade active in" id="no_user">
						<div class="panel-body">

							<form class="form form-horizontal" action="{:U('Member/member_add')}" method="post" role="form">
								<div class="line line-dashed line-lg pull-in"></div>
								<div class="form-group">
									<label class="col-sm-2 control-label">手机号*</label>
									<div class="col-md-2">
										<input type="text" class="form-control"  data="手机号" name="mobile" required="" value="{$w_config.mobile}" aria-required="true">
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">密码*</label>
									<div class="col-md-2">
										<input type="text" class="form-control"   data="密码"  name="password" required="" value="{$w_config.password}" aria-required="true">
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">昵称*</label>
									<div class="col-md-2">
										<input type="text" class="form-control" data="昵称" name="nickname" required="" value="{$w_config.name}" aria-required="true">
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">性别*</label>
									<div class="col-md-2">
										<label><input type="radio" checked="checked" name="sex" value="1">男&nbsp;&nbsp;</label>
										<label><input name="sex" type="radio" value="2">女&nbsp;&nbsp;</label>
										<label><input name="sex" type="radio" value="0">保密</label>
									</div>
									<label class="col-md-6  error"></label>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">账户状态*</label>
									<div class="col-md-2">
										<label><input type="radio" checked="checked" name="status" value="1">正常&nbsp;&nbsp;</label>
										<label><input name="status" type="radio" value="0">锁定</label>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">会员等级*</label>
									<div class="col-md-2">
										<select  name="grade">
											<option value="1">普通会员</option>
											<option value="2">银卡会员</option>
											<option value="3">金卡会员</option>
											<option value="4">合伙人</option>
										</select>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">积分*</label>
									<div class="col-md-2">
										<input type="text" class="form-control"  data="积分"  name="integral" required="" value="{$w_config.integral}" aria-required="true">
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">余额*</label>
									<div class="col-md-2">
										<input type="text" class="form-control"  data="余额" name="money" required="" value="{$w_config.money}" aria-required="true">
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">结束时间*</label>
									<div class="col-md-2">
										<input class="input-medium" type="text"   name="end_time" style="width:250px;" onclick="WdatePicker({skin:'twoer',dateFmt:'yyyy-MM-dd HH:mm:ss'})" data="结束时间">
									</div>
								</div>
								<div class="line line-dashed line-lg pull-in"></div>
								<div class="form-group">
									<div class="col-sm-4 col-sm-offset-2">
										<button class="btn btn-info formSubmit" id="form" type="button"><i class="icon-ok bigger-110"></i>提交</button>
										&nbsp; &nbsp; &nbsp;
										<button class="btn" type="button" onclick="history.back(-1);"><i class="icon-undo bigger-110"></i>返回</button>
									</div>
								</div>
							</form>
						</div>
					</div>
					<div class="tab-pane fade" id="user">
						<div class="panel-body">
							<form class="form form-horizontal" action="{:U('Member/member_add')}" method="post" role="form">
								<input type="hidden" name="type" value="1" />
								<div class="line line-dashed line-lg pull-in"></div>
								<div class="form-group">
									<label class="col-sm-2 control-label">已注册手机号*</label>
									<div class="col-md-2">
										<td colspan="3">
											<input type="text" class="form-control" id="res_phone" value="" style="float: left;width: 70%;margin-right: 2%;">
											<input type="button" id="search_res_phone" value="搜索" class="btn btn-sm" style="float: left;">
										</td>
									</div>
									<label class="col-md-6  error" for="mobile"></label>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">用户ID*</label>
									<div class="col-md-2">
										<input type="text" id="b_uid"  autocomplete="off" name="uid" value="{$rs_p.u_id}" readonly></div>
									<label class="col-md-6  error" for="password"></label>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">会员等级*</label>
									<div class="col-md-2">
										<select id="grade" name="grade">
											<option value="1">普通会员</option>
											<option value="2">银卡会员</option>
											<option value="3">金卡会员</option>
											<option value="4">合伙人</option>
										</select>
									</div>
									<label class="col-md-6  error" for="grade"></label>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">积分*</label>
									<div class="col-md-2">
										<input type="text" class="form-control" id="integral" name="integral" required="" value="{$w_config.integral}" aria-required="true">
									</div>
									<label class="col-md-6  error" for="integral"></label>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">余额*</label>
									<div class="col-md-2">
										<input type="text" class="form-control" id="money" name="money" required="" value="{$w_config.money}" aria-required="true">
									</div>
									<label class="col-md-6  error" for="money"></label>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">结束时间*</label>
									<div class="col-md-2">
										<input class="input-medium" type="text" id="end_time" name="end_time" style="width:250px;" onclick="WdatePicker({skin:'twoer',dateFmt:'yyyy-MM-dd HH:mm:ss'})" datatype="required" data="开始时间">
									</div>
									<label class="col-md-6  error" for="end_time"></label>
								</div>
								<div class="line line-dashed line-lg pull-in"></div>
								<div class="form-group">
									<div class="col-sm-4 col-sm-offset-2">
										<button class="btn btn-info formSubmit" id="form" type="button"><i class="icon-ok bigger-110"></i>提交</button>
										&nbsp; &nbsp; &nbsp;
										<button class="btn" type="button" onclick="history.back(-1);"><i class="icon-undo bigger-110"></i>返回</button>
									</div>
								</div>
							</form>
						</div>
					</div>

				</div>
			</div>
		</section>
	</section>
	<include file="Public:footer" />
	<script type="text/javascript">
		$('#user').click(function(){
            $('#no_user').hide();
            $('#no_user').hide();
        });
        $('#no_user').click(function(){
            $('#user').hide();
        });
        $('#search_res_phone').click(function(){
            var phone=$('#res_phone').val();
            if(phone){
                $.get('/Member/search_phone/phone/'+phone, function(data) {
                    if(data==0){
                        layer.msg('该用户不存在！');
                    }else if(data==1){
                        layer.msg('该用户已经开店！');
                    }else{
                        $('#b_uid').val(data.id);
                    }
                });
            }else{
                layer.msg('请输入绑定手机号');
            }
        });
	</script>